<template>
  <el-select v-model="jgxlid" placeholder="请选择线路" clearable filterable class="filter-item" style="width: 200px;" @change="change">
    <el-option v-for="item in list" :key="item.jgxlid" :label="item.xlmc" :value="item.jgxlid" />
  </el-select>
</template>
<script>
import { getGjxlList } from '@/api/gjxxgl';

export default {
  name: 'Xl',
  data() {
    return {
      jgxlid: null,
      list: []
    };
  },
  mounted() {
    this.getList();
  },
  methods: {
    async getList() {
      await getGjxlList().then(response => {
        this.list = response.data;
      });
    },
    change() {
      this.$emit('change', this.jgxlid);
    }
  }
};
</script>
